<?php
$id=$_GET['id'];
@mysql_connect('localhost', 'root', 'root');
if (mysql_errno()) {
	die(mysql_errno());
}
mysql_select_db('blog');
mysql_set_charset('utf8');
$sql="delete from `liuyan` where id='$id'";
$res=mysql_query($sql);

if ($res) {
    echo "<script>alert('删除成功');window.location.href='liuyan.php'</script>";
}
else{
    echo "<script>alert('删除失败');window.location.href='liuyan.php'</script>";
}

mysql_close();

?>